﻿$(function($) {
	$('[data-rel=tooltip]').tooltip({
		'container': 'body'
	}); //初始化提示
	//切换配置框是否可见
	$('#id-toggle-setting').on('click', function(event) {
		//		console.log(event.target);
		event.preventDefault();
		$('#ace-settings-box').toggleClass('open');
	});
	//	$("html").click(function(event) {
	//		$('#ace-settings-box').removeClass('open');	
	//	});

	//-----------------菜单操作-----------------
	var globalMenu = new GlobalMenu();
	globalMenu.init();
	
	//-----------------按钮小图标操作-----------------
	//点击主页按钮
	$("#id-btn-home").on("click", function(e) {
		alert("回到首页");
	});
	//点击刷新按钮
	$("#id-btn-refresh").on("click", function(e) {
		globalMenu.refresh();
	});
	//点击修改密码按钮
	$("#id-btn-edit-password,#id-a-edit-password").on("click", function(e) {
		alert("修改用户密码");
	});
	//点击退出按钮
	$("#id-btn-exit,#id-a-exit").on("click", function(e) {
		alert("退出系统");
	});
	//factory directive contrller
	//config run 
	//route
	//scope rootScope
	//--------------动态调整窗口大小
	adjustIframe();
	function adjustIframe() {
        var height = $(window).height();
        var pos = $("#iframe-container").position();
        $("#iframe-container").css("height",(height-pos.top)+"px");
     }
	$(window).resize(adjustIframe);
});




/*angular.module('app', [])
	.directive('globalMenu2', function() {
		return {
			restrict: 'EAC',
			template: function(elem, attr) {
				var str = "";

				return str;
			},
			link: function(scope, element, attrs) {

			}
		};
	});*/